// 路由懒加载
import { lazy } from "react";
// 重定向
import { Navigate } from "react-router-dom";
// 一级路由
var Login = lazy(() => import("../view/Login/index"))
var Index = lazy(() => import("../view/Index"))
var NotFound = lazy(() => import("../view/NoFound"))
// index的二级路由
var Datanalysis = lazy(() => import("../view/Index/Datanalysis"))
var Opermanage = lazy(() => import("../view/Index/Opermanage"))
var Commanage = lazy(() => import("../view/Index/Commanage"))
var Ordermanage = lazy(() => import("../view/Index/Ordermanage"))
var Financemanage = lazy(() => import("../view/Index/Financemanage"))
var AddCom = lazy(() => import("../view/Index/AddCom"))
var Home = lazy(() => import("../view/Index/Home"))
var OrderSeckirt = lazy(() => import("../view/Index/OrderSeckirt"))
export default [
    {
        path: "/index",
        element: <Index></Index>,
        children: [
            {
                path: "/index/datanalysis",
                element: <Datanalysis></Datanalysis>
            },
            {
                path: "/index/opermanage",
                element: <Opermanage ></Opermanage>
            },
            {
                path: "/index/commanage",
                element: <Commanage></Commanage>
            },
            {
                path: "/index/ordermanage",
                element: <Ordermanage></Ordermanage>
            },
            {
                path: "/index/financemanage",
                element: <Financemanage ></Financemanage>
            }, {
                path: "/index/orderseckirt",
                element: <OrderSeckirt></OrderSeckirt>
            },
            {
                path: "/index/home",
                element: <Home></Home>
            },
            {
                path: "/index",
                element: <Navigate to="/index/home"></Navigate>
            },
            {
                path: "/index/addcom/:id",
                element: <AddCom></AddCom>
            },
            {
                path: "*",
                element: <NotFound></NotFound>
            },

        ]
    },
    {
        path: "/login",
        element: <Login></Login>
    },
    {
        path: "/",
        element: <Navigate to="/login" ></Navigate>
    },
    {
        path: "*",
        element: <NotFound></NotFound>
    }
]
